// lua_mysql.h
#include <lua.hpp>

#define LUA_LIB __declspec(dllexport) int

extern "C" LUA_LIB luaopen_lua_mysql(lua_State *L);
static time_t convertStr2Time(const char *s);

static int l_getDriverInstance(lua_State *L);
static int l_Driver_connect(lua_State *L);

static int l_Connection_testMethod(lua_State *L);
static int l_Connection_close(lua_State *L);
static int l_Connection_createStatement(lua_State *L);
static int l_Connection_prepareStatement(lua_State *L);
static int l_Connection_setAutoCommit(lua_State *L);
static int l_Connection_rollback(lua_State *L);
static int l_Connection_commit(lua_State *L);
static int l_Connection_getGeneratedId(lua_State *L);

static int l_Statement_execute(lua_State *L);
static int l_Statement_close(lua_State *L);
static int l_Statement_executeUpdate(lua_State *L);
static int l_Statement_executeQuery(lua_State *L);

//static int l_PreparedStatement_executeString(lua_State *L);
static int l_PreparedStatement_execute(lua_State *L);
static int l_PreparedStatement_executeQuery(lua_State *L);
//static int l_PreparedStatement_executeQueryString(lua_State *L);
//static int l_PreparedStatement_executeUpdateString(lua_State *L);
static int l_PreparedStatement_executeUpdate(lua_State *L);
static int l_PreparedStatement_setBigInt(lua_State *L);
static int l_PreparedStatement_setTimestamp(lua_State *L);
static int l_PreparedStatement_setBoolean(lua_State *L);
static int l_PreparedStatement_setDateTime(lua_State *L);
static int l_PreparedStatement_setDouble(lua_State *L);
static int l_PreparedStatement_setInt(lua_State *L);
static int l_PreparedStatement_setNull(lua_State *L);
static int l_PreparedStatement_setString(lua_State *L);
static int l_PreparedStatement_setResultSetType(lua_State *L);
static int l_PreparedStatement_close(lua_State *L);

static int l_Resultset_close(lua_State *L);
static int l_Resultset_rowsCount(lua_State *L);
static int l_Resultset_absolute(lua_State *L);
static int l_Resultset_inext(lua_State *L);
static int l_Resultset_first(lua_State *L);
static int l_Resultset_last(lua_State *L);
static int l_Resultset_previous(lua_State *L);
static int l_Resultset_beforeFirst(lua_State *L);
static int l_Resultset_afterLast(lua_State *L);
static int l_Resultset_isAfterLast(lua_State *L);
static int l_Resultset_isBeforeFirst(lua_State *L);
static int l_Resultset_isFirst(lua_State *L);
static int l_Resultset_isLast(lua_State *L);
static int l_Resultset_isNull(lua_State *L);
static int l_Resultset_getType(lua_State *L);
static int l_Resultset_findColumn(lua_State *L);
static int l_Resultset_getBoolean(lua_State *L);
static int l_Resultset_getDouble(lua_State *L);
static int l_Resultset_getInt(lua_State *L);
static int l_Resultset_getString(lua_State *L);
static int l_Resultset_getTimestamp(lua_State *L);
static int l_Resultset_iter(lua_State *L);
static int l_Resultset_iter_next(lua_State *L);
